	package zhaowenpu;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import zhaowenpu.bean.Students;
import zhaowenpu.dao.Userlnfo;
import zhaowenpu.dao.Userlnfolmpl;
@WebServlet("/InsertStudents")
public class InsertStudents extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		Students st=new Students();
		String name = req.getParameter("name");
		String sex = req.getParameter("sex");
		String address = req.getParameter("address");

		st.setSName(name);
		st.setSSex(sex);
		st.setSAddress(address);
		Userlnfo ui= new Userlnfolmpl();
		ui.InsertStudents(st);
		resp.sendRedirect("CheckAllStudents");
		
		
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req, resp);
	}
	
	

}
